package com.lx.wiki.controller;

import com.lx.wiki.domain.Test;
import com.lx.wiki.service.TestService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


@RestController
public class TestController {

    @Value("${test.hello}")
    private String testHello;

    @Resource
    private TestService testService;



    @GetMapping("/hello")
    public String hello(){
        return "Hello world!"+testHello;
    }

    @GetMapping("/test/list")
    public List<Test> list(){

        return testService.list();
    }





}
